#!python
# (C) Copyright 2018-2021 Intel Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
"""Build cart_ctl test"""

import os
import daos_build

SRC = ['cart_ctl.c']

def scons():
    """scons function"""
    Import('env', 'prereqs', 'cart_utils_objs')

    tenv = env.Clone(LIBS=[])
    tenv.AppendUnique(LIBS=['cart', 'gurt', 'pthread', 'daos', 'daos_common'])
    tenv.AppendUnique(CPPPATH=[Dir('../../../src/mgmt').srcnode()])

    prereqs.require(tenv, 'mercury', 'protobufc')

    ctl = daos_build.program(tenv, [SRC, cart_utils_objs])
    tenv.Install(os.path.join("$PREFIX", 'bin'), ctl)

if __name__ == "SCons.Script":
    scons()
